<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>多线程查询 | Threadv</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="线程简单使用1234567class ThreadResult&amp;#123;      public List&amp;lt;GroupStoryThread&amp;gt; storyThreads=new ArrayList&amp;lt;&amp;gt;();      public List&amp;lt">
<meta name="keywords" content="线程">
<meta property="og:type" content="article">
<meta property="og:title" content="多线程查询">
<meta property="og:url" content="http://yoursite.com/2018/11/05/多线程查询/index.html">
<meta property="og:site_name" content="Threadv">
<meta property="og:description" content="线程简单使用1234567class ThreadResult&amp;#123;      public List&amp;lt;GroupStoryThread&amp;gt; storyThreads=new ArrayList&amp;lt;&amp;gt;();      public List&amp;lt;GroupSerialThread&amp;gt; serialThreads=new ArrayList&amp;lt;&amp;gt;();">
<meta property="og:updated_time" content="2020-03-29T11:01:38.438Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="多线程查询">
<meta name="twitter:description" content="线程简单使用1234567class ThreadResult&amp;#123;      public List&amp;lt;GroupStoryThread&amp;gt; storyThreads=new ArrayList&amp;lt;&amp;gt;();      public List&amp;lt;GroupSerialThread&amp;gt; serialThreads=new ArrayList&amp;lt;&amp;gt;();">
  
    <link rel="alternate" href="/atom.xml" title="Threadv" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Threadv</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Suche"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-多线程查询" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/11/05/多线程查询/" class="article-date">
  <time datetime="2018-11-05T03:20:36.000Z" itemprop="datePublished">2018-11-05</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      多线程查询
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h5 id="线程简单使用"><a href="#线程简单使用" class="headerlink" title="线程简单使用"></a>线程简单使用</h5><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">ThreadResult</span></span>&#123;</span><br><span class="line">      <span class="keyword">public</span> List&lt;GroupStoryThread&gt; storyThreads=<span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">      <span class="keyword">public</span> List&lt;GroupSerialThread&gt; serialThreads=<span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">      <span class="keyword">public</span> GroupAdThread groupAdThread=<span class="keyword">null</span>;</span><br><span class="line">      <span class="keyword">public</span> GroupPromptThread groupPromptThread=<span class="keyword">null</span>;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
<h6 id="线程"><a href="#线程" class="headerlink" title="线程"></a>线程</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">public class GroupStoryThread implements Runnable &#123;</span><br><span class="line">    Logger logger=Logger.getLogger(GroupSerialThread.class);</span><br><span class="line">    GroupRelevanceService groupRelevanceService;</span><br><span class="line">    Page&lt;Story&gt; storyPage;</span><br><span class="line">    User user;</span><br><span class="line">    int groupId;</span><br><span class="line">    int pageNo;</span><br><span class="line">    int pageSize;</span><br><span class="line">    public GroupStoryThread(GroupRelevanceService groupRelevanceService, User user, int groupId, int pageNo, int pageSize)&#123;</span><br><span class="line">        this.groupRelevanceService=groupRelevanceService;</span><br><span class="line">        this.user=user;</span><br><span class="line">        this.groupId=groupId;</span><br><span class="line">        this.pageNo=pageNo;</span><br><span class="line">        this.pageSize=pageSize;</span><br><span class="line">    &#125;</span><br><span class="line">    @Override</span><br><span class="line">    public void run() &#123;</span><br><span class="line">//        logger.info(&quot;------storys begin&quot;);</span><br><span class="line">       storyPage = groupRelevanceService.getNewGroupStoryList(user, groupId, pageNo, pageSize);</span><br><span class="line">//        logger.info(&quot;------storys end&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public Page&lt;Story&gt; getStoryPage() &#123;</span><br><span class="line">        return storyPage;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public int getGroupId() &#123;</span><br><span class="line">        return groupId;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">GroupSerialThread</span> <span class="keyword">implements</span> <span class="title">Runnable</span> </span>&#123;</span><br><span class="line">    Logger logger=Logger.getLogger(GroupSerialThread.class);</span><br><span class="line"></span><br><span class="line">    SerialStoryStyle serialStoryStyle;</span><br><span class="line"></span><br><span class="line">    SerialStoryService serialStoryService;</span><br><span class="line">    List&lt;SerialStory&gt; serialStoryList;</span><br><span class="line">    User user;</span><br><span class="line">    Integer pageNo;</span><br><span class="line">    Integer pageSize;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">GroupSerialThread</span><span class="params">(SerialStoryService serialStoryService,SerialStoryStyle serialStoryStyle, User user, <span class="keyword">int</span> pageNo, <span class="keyword">int</span> pageSize)</span></span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.serialStoryService=serialStoryService;</span><br><span class="line">        <span class="keyword">this</span>.user=user;</span><br><span class="line">        <span class="keyword">this</span>.pageNo=pageNo;</span><br><span class="line">        <span class="keyword">this</span>.pageSize=pageSize;</span><br><span class="line">        <span class="keyword">this</span>.serialStoryStyle=serialStoryStyle;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line"><span class="comment">//        logger.info("-----begin serial");</span></span><br><span class="line">        <span class="keyword">int</span> userid=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">if</span>(user!=<span class="keyword">null</span>)&#123;</span><br><span class="line">            userid=user.getId().intValue();</span><br><span class="line">        &#125;</span><br><span class="line">        Page&lt;SerialStory&gt; serialStoryPage = serialStoryService.getCommonSerialStoryPage((<span class="keyword">long</span>)userid, serialStoryStyle, pageNo,pageSize);</span><br><span class="line">        serialStoryList = serialStoryPage.getContent();</span><br><span class="line">        <span class="keyword">for</span>(SerialStory item : serialStoryList)&#123;</span><br><span class="line">            serialStoryService.setSerialStoryIsBuy(user,item);</span><br><span class="line">        &#125;</span><br><span class="line"><span class="comment">//        logger.info("-----end serial");</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;SerialStory&gt; <span class="title">getSerialStoryList</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> serialStoryList;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> SerialStoryStyle <span class="title">getSerialStoryStyle</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> serialStoryStyle;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">GroupPromptThread</span> <span class="keyword">implements</span> <span class="title">Runnable</span> </span>&#123;</span><br><span class="line">    Logger logger=Logger.getLogger(GroupPromptThread.class);</span><br><span class="line">    PromptService promptService;</span><br><span class="line">    Prompt prompt;</span><br><span class="line">    User user;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">GroupPromptThread</span><span class="params">(PromptService promptService, User user)</span></span>&#123;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.promptService=promptService;</span><br><span class="line">        <span class="keyword">this</span>.user=user;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line"><span class="comment">//        logger.info("----begin prompt");</span></span><br><span class="line">        <span class="keyword">int</span> userId=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">if</span>(user!=<span class="keyword">null</span>)&#123;</span><br><span class="line">            userId=user.getId().intValue();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(userId!=<span class="number">0</span>)&#123;</span><br><span class="line">            <span class="keyword">try</span> &#123;</span><br><span class="line">                prompt = promptService.getPrompt(userId);</span><br><span class="line"></span><br><span class="line">            &#125;<span class="keyword">catch</span> (Exception e)&#123;</span><br><span class="line">                e.printStackTrace();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">              prompt=<span class="keyword">new</span> Prompt(PromptStyle.STUDY_PLAN.getId(),PromptStyle.STUDY_PLAN.getName(),PromptStyle.STUDY_PLAN.getUrl());</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">//        logger.info("----end prompt");</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> Prompt <span class="title">getPrompt</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> prompt;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">GroupAdThread</span> <span class="keyword">implements</span> <span class="title">Runnable</span> </span>&#123;</span><br><span class="line">    Logger logger=Logger.getLogger(GroupAdThread.class);</span><br><span class="line">    AdService adService;</span><br><span class="line">    List&lt;Ads&gt; adsList;</span><br><span class="line">    String channel;</span><br><span class="line">    String platform;</span><br><span class="line">    User user;</span><br><span class="line">    <span class="keyword">int</span> isCheckVer;</span><br><span class="line">    String ver;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">GroupAdThread</span><span class="params">(AdService adService, String channel,String platform,<span class="keyword">int</span> isCheckVer,String ver,User user)</span></span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.channel=channel;</span><br><span class="line">        <span class="keyword">this</span>.platform=platform;</span><br><span class="line">        <span class="keyword">this</span>.adService=adService;</span><br><span class="line">        <span class="keyword">this</span>.isCheckVer=isCheckVer;</span><br><span class="line">        <span class="keyword">this</span>.user=user;</span><br><span class="line">        <span class="keyword">this</span>.ver=ver;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line"><span class="comment">//        logger.info("------begin ad");</span></span><br><span class="line">        adsList=adService.getAds(<span class="number">0</span>,<span class="number">8</span>,isCheckVer,channel,platform,ver,user);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span>(user != <span class="keyword">null</span> &amp;&amp; user.getIsTest().equals(<span class="number">1</span>))&#123;</span><br><span class="line">            List&lt;Ads&gt; adsTestList = adService.getTestAds();</span><br><span class="line">            List&lt;Ads&gt; newAdsList = <span class="keyword">new</span> ArrayList&lt;&gt;(adsList);</span><br><span class="line">            newAdsList.addAll(adsTestList);</span><br><span class="line">            adsList=newAdsList;</span><br><span class="line">        &#125;</span><br><span class="line"><span class="comment">//        logger.info("------end ad");</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;Ads&gt; <span class="title">getAdsList</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> adsList;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<hr>
<ul>
<li><p>response</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">GetIndex280Response</span> <span class="keyword">extends</span> <span class="title">ApiResponse</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">    List&lt;Ads&gt; ads;</span><br><span class="line">    <span class="comment">/** 精品推荐*/</span></span><br><span class="line">    CustomGroup recommendGroup;</span><br><span class="line">    <span class="comment">/** 最新故事*/</span></span><br><span class="line">    List&lt;DisplayGroup&gt; newStoryGroup;</span><br><span class="line">    <span class="comment">/** 精品课程 */</span></span><br><span class="line">    LessonIndex lessonIndex;</span><br><span class="line">    <span class="comment">/** 故事足迹*/</span></span><br><span class="line">    CustomGroup userReadRecordGroup;</span><br><span class="line">    <span class="comment">/**飞船电台 */</span></span><br><span class="line">    CustomGroup radioGroup;</span><br><span class="line">    <span class="comment">/**IP专区 */</span></span><br><span class="line">    CustomGroup ipStoryGroup;</span><br><span class="line">    <span class="comment">/**经典故事 &amp;&amp; 创意思维 */</span></span><br><span class="line">    List&lt;DisplayGroup&gt; classicAndCreateGroup;</span><br><span class="line">    <span class="comment">/**绘本丛书 */</span></span><br><span class="line">    CustomGroup serialGroup;</span><br><span class="line">    <span class="comment">/**情感教育 &amp;&amp;幽默故事 */</span></span><br><span class="line">    List&lt;DisplayGroup&gt; emotionAndHumourGroup;</span><br><span class="line">    <span class="comment">/**益智训练专区 */</span></span><br><span class="line">    CustomGroup gameSerialGroup;</span><br><span class="line">    <span class="comment">/**传统文化 */</span></span><br><span class="line">    List&lt;DisplayGroup&gt; traditionCultureGroup;</span><br><span class="line">    <span class="comment">/**其他分类 */</span></span><br><span class="line">    List&lt;DisplayGroup&gt; otherGroup;</span><br><span class="line"></span><br><span class="line">    Integer isSvip;</span><br><span class="line"></span><br><span class="line">    Prompt prompt;</span><br><span class="line"></span><br><span class="line">    Integer serialStoryCount;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;Ads&gt; <span class="title">getAds</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> ads;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setAds</span><span class="params">(List&lt;Ads&gt; ads)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.ads = ads;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getRecommendGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> recommendGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setRecommendGroup</span><span class="params">(CustomGroup recommendGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.recommendGroup = recommendGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;DisplayGroup&gt; <span class="title">getNewStoryGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> newStoryGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setNewStoryGroup</span><span class="params">(List&lt;DisplayGroup&gt; newStoryGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.newStoryGroup = newStoryGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> LessonIndex <span class="title">getLessonIndex</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> lessonIndex;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setLessonIndex</span><span class="params">(LessonIndex lessonIndex)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.lessonIndex = lessonIndex;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getUserReadRecordGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> userReadRecordGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setUserReadRecordGroup</span><span class="params">(CustomGroup userReadRecordGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.userReadRecordGroup = userReadRecordGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getRadioGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> radioGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setRadioGroup</span><span class="params">(CustomGroup radioGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.radioGroup = radioGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getIpStoryGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> ipStoryGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setIpStoryGroup</span><span class="params">(CustomGroup ipStoryGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.ipStoryGroup = ipStoryGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;DisplayGroup&gt; <span class="title">getClassicAndCreateGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> classicAndCreateGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setClassicAndCreateGroup</span><span class="params">(List&lt;DisplayGroup&gt; classicAndCreateGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.classicAndCreateGroup = classicAndCreateGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;DisplayGroup&gt; <span class="title">getEmotionAndHumourGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> emotionAndHumourGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setEmotionAndHumourGroup</span><span class="params">(List&lt;DisplayGroup&gt; emotionAndHumourGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.emotionAndHumourGroup = emotionAndHumourGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getSerialGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> serialGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setSerialGroup</span><span class="params">(CustomGroup serialGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.serialGroup = serialGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> CustomGroup <span class="title">getGameSerialGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> gameSerialGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setGameSerialGroup</span><span class="params">(CustomGroup gameSerialGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.gameSerialGroup = gameSerialGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;DisplayGroup&gt; <span class="title">getOtherGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> otherGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setOtherGroup</span><span class="params">(List&lt;DisplayGroup&gt; otherGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.otherGroup = otherGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> Integer <span class="title">getIsSvip</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> isSvip;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setIsSvip</span><span class="params">(Integer isSvip)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.isSvip = isSvip;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> Prompt <span class="title">getPrompt</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> prompt;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setPrompt</span><span class="params">(Prompt prompt)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.prompt = prompt;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> Integer <span class="title">getSerialStoryCount</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> serialStoryCount;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setSerialStoryCount</span><span class="params">(Integer serialStoryCount)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.serialStoryCount = serialStoryCount;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> List&lt;DisplayGroup&gt; <span class="title">getTraditionCultureGroup</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> traditionCultureGroup;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setTraditionCultureGroup</span><span class="params">(List&lt;DisplayGroup&gt; traditionCultureGroup)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.traditionCultureGroup = traditionCultureGroup;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>controller </p>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br></pre></td><td class="code"><pre><span class="line"> <span class="meta">@RequestMapping</span>(value = <span class="string">"getIndex"</span>, method = RequestMethod.GET)</span><br><span class="line">    <span class="meta">@ResponseBody</span></span><br><span class="line">    <span class="meta">@ApiOperation</span>(value = <span class="string">"首页 版本开始"</span>)</span><br><span class="line">    <span class="function">GetIndex280Response <span class="title">getIndex</span><span class="params">(</span></span></span><br><span class="line"><span class="function"><span class="params">            @RequestHeader(value = <span class="string">"ssToken"</span>, required = <span class="keyword">false</span>)</span> String ssToken,</span></span><br><span class="line"><span class="function">            @<span class="title">ApiParam</span><span class="params">(value = <span class="string">"版本号"</span>, defaultValue = <span class="string">""</span>, required = <span class="keyword">false</span>)</span> @<span class="title">RequestParam</span><span class="params">(required = <span class="keyword">false</span>, defaultValue = <span class="string">""</span>)</span> String ver</span></span><br><span class="line"><span class="function">    ) </span>&#123;</span><br><span class="line">        GetIndex280Response response = <span class="keyword">new</span> GetIndex280Response();</span><br><span class="line">        Long loginId = (Long) request.getAttribute(<span class="string">"loginId"</span>);</span><br><span class="line">        User user = userService.getUser(loginId.intValue());</span><br><span class="line">        <span class="keyword">int</span> userid=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">if</span>(user!=<span class="keyword">null</span>)&#123;</span><br><span class="line">            userid=user.getId().intValue();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//Ads  处理广告   判断设备</span></span><br><span class="line">        Integer isCheckVer = <span class="number">0</span>;</span><br><span class="line">        String userAgent = request.getHeader(<span class="string">"User-Agent"</span>);</span><br><span class="line">        String version = VersionUtil.getVerionInfo(request);</span><br><span class="line">        <span class="keyword">if</span> (userAgent.contains(<span class="string">"ios"</span>)) &#123;</span><br><span class="line">            <span class="comment">//判断版本是否在审核中，获取config的ver是否等于当前版本</span></span><br><span class="line">            String key = <span class="string">"version"</span>;</span><br><span class="line">            <span class="keyword">if</span> (userAgent.contains(<span class="string">"appname:zhijianStory"</span>)) &#123;</span><br><span class="line">                key = <span class="string">"zhijianStory"</span> + <span class="string">"_version"</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            Config config = <span class="keyword">this</span>.configService.getConfigByKey(key);</span><br><span class="line">            <span class="keyword">if</span> (version.compareTo(config.getVal()) == <span class="number">0</span>) &#123;</span><br><span class="line">                isCheckVer = <span class="number">1</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        String channel = request.getHeader(<span class="string">"channel"</span>);</span><br><span class="line">        String platform = VersionUtil.getPlatformStr(request);</span><br><span class="line">        List&lt;Ads&gt; adsList=adsService.getAds(<span class="number">0</span>,<span class="number">8</span>,isCheckVer,channel,platform,ver,user);</span><br><span class="line">        <span class="keyword">if</span>(user != <span class="keyword">null</span> &amp;&amp; user.getIsTest().equals(<span class="number">1</span>))&#123;</span><br><span class="line">            List&lt;Ads&gt; adsTestList = adsService.getTestAds();</span><br><span class="line">            List&lt;Ads&gt; newAdsList = <span class="keyword">new</span> ArrayList&lt;&gt;(adsList);</span><br><span class="line">            newAdsList.addAll(adsTestList);</span><br><span class="line">            adsList=newAdsList;</span><br><span class="line">        &#125;</span><br><span class="line">        response.setAds(adsList);</span><br><span class="line">        <span class="comment">//精品推荐</span></span><br><span class="line">        Ads ads = <span class="keyword">new</span> Ads();</span><br><span class="line">        ads.setTitle(<span class="string">"精品推荐"</span>);</span><br><span class="line">        ads.setContent(<span class="string">"精品推荐"</span>);</span><br><span class="line">        ads.setUrl(<span class="string">"www.baidu.com"</span>);</span><br><span class="line">        ads.setImgPath(<span class="string">"recommend.png"</span>);</span><br><span class="line">        ads.setIcon(<span class="string">"recommend.png"</span>);</span><br><span class="line">        ads.setId(<span class="number">0L</span>);</span><br><span class="line">        ads.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        ads.setTargetType(<span class="number">0</span>);</span><br><span class="line">        ads.setStatus(<span class="number">0</span>);</span><br><span class="line">        ads.setOrderBy(<span class="number">0</span>);</span><br><span class="line">        ads.setCreateTime(<span class="keyword">new</span> Date());</span><br><span class="line">        ads.setIsIosVisual(<span class="number">0</span>);</span><br><span class="line">        ads.setAdsPosition(<span class="number">0</span>);</span><br><span class="line"></span><br><span class="line">        CustomGroup recommendGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        recommendGroup.setId(<span class="number">1005L</span>);</span><br><span class="line">        recommendGroup.setName(<span class="string">"精品推荐"</span>);</span><br><span class="line">        recommendGroup.setContent(<span class="string">"精品推荐"</span>);</span><br><span class="line">        recommendGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        recommendGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        recommendGroup.setTargetType(StoryGroupStyle.RECOMMEND.getTargetType());</span><br><span class="line">        recommendGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        recommendGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        recommendGroup.setAds(ads);</span><br><span class="line">        response.setRecommendGroup(recommendGroup);</span><br><span class="line"></span><br><span class="line">        <span class="comment">//最新故事 groupId  1 互动故事 2 益智游戏 3 限时免费 4 精品课程  5 系列故事  6 睡前故事  7 热销故事 8 音频 9 经典故事</span></span><br><span class="line">        <span class="comment">//10 情感教育  11 幽默故事  12 创意思维 13 小程序试看  14 传统文化 16 飞船电台  17 最新故事</span></span><br><span class="line"></span><br><span class="line">        <span class="comment">//最新故事</span></span><br><span class="line">        List&lt;DisplayGroup&gt; newStoryList = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        DisplayGroup newSoryGroup = displayGroupService.getGroupById(<span class="number">17L</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage17 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">17</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        newSoryGroup.setStorys(storyPage17.getContent());</span><br><span class="line">        newStoryList.add(newSoryGroup);</span><br><span class="line">        response.setNewStoryGroup(newStoryList);</span><br><span class="line">        <span class="comment">//精品课程</span></span><br><span class="line">        LessonIndex lessonIndex = <span class="keyword">new</span> LessonIndex();</span><br><span class="line">        lessonIndex.setName(<span class="string">"精品阅读课"</span>);</span><br><span class="line">        lessonIndex.setContent(<span class="string">"精品阅读课"</span>);</span><br><span class="line">        lessonIndex.setTargetType(StoryGroupStyle.LESSON.getTargetType());</span><br><span class="line">        lessonIndex.setIntro(<span class="string">""</span>);</span><br><span class="line">        lessonIndex.setLessonList(lessonService.getLessonList());</span><br><span class="line">        response.setLessonIndex(lessonIndex);</span><br><span class="line">        <span class="comment">//故事足迹  故事类型 type=1 4条</span></span><br><span class="line">        <span class="keyword">if</span>(userid!=<span class="number">0</span>)&#123;</span><br><span class="line">            Page&lt;UserReadRecord&gt; readRecordPage = userReadRecordService.getReadStoryRecordByUserIdAndType(user.getId(), <span class="number">1</span>, <span class="number">0</span>, <span class="number">4</span>);</span><br><span class="line">            CustomGroup userReadRecordGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">            userReadRecordGroup.setId(<span class="number">1000L</span>);</span><br><span class="line">            userReadRecordGroup.setName(<span class="string">"故事足迹"</span>);</span><br><span class="line">            userReadRecordGroup.setContent(<span class="string">"故事足迹"</span>);</span><br><span class="line">            userReadRecordGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">            userReadRecordGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">            userReadRecordGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">            userReadRecordGroup.setTargetType(StoryGroupStyle.RECORD.getTargetType());</span><br><span class="line">            userReadRecordGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">            userReadRecordGroup.setUserReadRecordList(readRecordPage.getContent());</span><br><span class="line">            List&lt;Story&gt; storys = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">            <span class="keyword">for</span> (UserReadRecord s:readRecordPage.getContent()) &#123;</span><br><span class="line">                storys.add(s.getStory());</span><br><span class="line">            &#125;</span><br><span class="line">            userReadRecordGroup.setStorys(storys);</span><br><span class="line">            response.setUserReadRecordGroup(userReadRecordGroup);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//飞船电台</span></span><br><span class="line">        List&lt;Story&gt; radioList = storyService.getRadioList();</span><br><span class="line"><span class="comment">//        RadioGroup radioGroup = new RadioGroup();</span></span><br><span class="line">        CustomGroup radioGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        radioGroup.setId(<span class="number">1004L</span>);</span><br><span class="line">        radioGroup.setName(<span class="string">"飞船电台"</span>);</span><br><span class="line">        radioGroup.setContent(<span class="string">"飞船电台"</span>);</span><br><span class="line">        radioGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        radioGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        radioGroup.setTargetType(StoryGroupStyle.AUDIO.getTargetType());</span><br><span class="line">        radioGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        radioGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        radioGroup.setStorys(radioList);</span><br><span class="line">        response.setRadioGroup(radioGroup);</span><br><span class="line">        <span class="comment">//IP专区</span></span><br><span class="line">        Page&lt;SerialStory&gt; ipStoryPage = serialStoryService.getCommonSerialStoryPage((<span class="keyword">long</span>)userid, SerialStoryStyle.IP_STORY_SERIAL, <span class="number">0</span>,<span class="number">3</span>);</span><br><span class="line">        List&lt;SerialStory&gt; ipStoryList = ipStoryPage.getContent();</span><br><span class="line">        <span class="keyword">for</span>(SerialStory item : ipStoryList)&#123;</span><br><span class="line">            serialStoryService.setSerialStoryIsBuy(user,item);</span><br><span class="line">        &#125;</span><br><span class="line">        CustomGroup ipSerialGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        ipSerialGroup.setId(<span class="number">1002L</span>);</span><br><span class="line">        ipSerialGroup.setName(<span class="string">"IP专区"</span>);</span><br><span class="line">        ipSerialGroup.setContent(<span class="string">"IP专区"</span>);</span><br><span class="line">        ipSerialGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        ipSerialGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        ipSerialGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        ipSerialGroup.setTargetType(StoryGroupStyle.SERIAL.getTargetType());</span><br><span class="line">        ipSerialGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        ipSerialGroup.setSerialStories(ipStoryList);</span><br><span class="line">        response.setIpStoryGroup(ipSerialGroup);</span><br><span class="line"></span><br><span class="line">        <span class="comment">//经典故事9 &amp;创意思维12</span></span><br><span class="line">        List&lt;DisplayGroup&gt; classicAndCreateGroup = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        DisplayGroup classicGroup = displayGroupService.getGroupById(<span class="number">9L</span>);</span><br><span class="line">        DisplayGroup createGroup =  displayGroupService.getGroupById(<span class="number">12L</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage9 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">9</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage12 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">12</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        classicGroup.setStorys(storyPage9.getContent());</span><br><span class="line">        createGroup.setStorys(storyPage12.getContent());</span><br><span class="line">        classicAndCreateGroup.add(classicGroup);</span><br><span class="line">        classicAndCreateGroup.add(createGroup);</span><br><span class="line">        response.setClassicAndCreateGroup(classicAndCreateGroup);</span><br><span class="line">        <span class="comment">//绘本丛书</span></span><br><span class="line">        Page&lt;SerialStory&gt; serialStoryPage = serialStoryService.getCommonSerialStoryPage((<span class="keyword">long</span>)userid, SerialStoryStyle.INDEX_SERIAL, <span class="number">0</span>,<span class="number">3</span>);</span><br><span class="line">        List&lt;SerialStory&gt; serialStoryList = serialStoryPage.getContent();</span><br><span class="line">        <span class="keyword">for</span>(SerialStory item : serialStoryList)&#123;</span><br><span class="line">            serialStoryService.setSerialStoryIsBuy(user,item);</span><br><span class="line">        &#125;</span><br><span class="line">        response.setSerialStoryCount(<span class="number">3</span>);</span><br><span class="line">        CustomGroup huiBenGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        huiBenGroup.setId(<span class="number">1000L</span>);</span><br><span class="line">        huiBenGroup.setName(<span class="string">"绘本丛书"</span>);</span><br><span class="line">        huiBenGroup.setContent(<span class="string">"绘本丛书"</span>);</span><br><span class="line">        huiBenGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        huiBenGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        huiBenGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        huiBenGroup.setTargetType(StoryGroupStyle.SERIAL.getTargetType());</span><br><span class="line">        huiBenGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        huiBenGroup.setSerialStories(serialStoryList);</span><br><span class="line">        response.setSerialGroup(huiBenGroup);</span><br><span class="line"></span><br><span class="line">        <span class="comment">//情感教育10 &amp;幽默故事11</span></span><br><span class="line">        List&lt;DisplayGroup&gt; emotionAndHumourGroup= <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        DisplayGroup emotionGroup =  displayGroupService.getGroupById(<span class="number">10L</span>);</span><br><span class="line">        DisplayGroup humourGroup =  displayGroupService.getGroupById(<span class="number">11L</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage10 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">10</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage11 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">11</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        emotionGroup.setStorys(storyPage10.getContent());</span><br><span class="line">        humourGroup.setStorys(storyPage11.getContent());</span><br><span class="line">        emotionAndHumourGroup.add(emotionGroup);</span><br><span class="line">        emotionAndHumourGroup.add(humourGroup);</span><br><span class="line">        response.setEmotionAndHumourGroup(emotionAndHumourGroup);</span><br><span class="line">        <span class="comment">//益智训练专区</span></span><br><span class="line">        GetSerialStoryPageResponse smartGameSerialStoryResponse = serialStoryController.getSmartGameSerialStoryPage(ssToken, SerialStoryStyle.SMART_GAME_SERIAL.getId(), <span class="number">1</span>, <span class="number">3</span>);</span><br><span class="line">        CustomGroup gameSerialGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        gameSerialGroup.setId(<span class="number">1003L</span>);</span><br><span class="line">        gameSerialGroup.setName(<span class="string">"益智训练专区"</span>);</span><br><span class="line">        gameSerialGroup.setContent(<span class="string">"益智训练专区"</span>);</span><br><span class="line">        gameSerialGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        gameSerialGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        gameSerialGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        gameSerialGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        gameSerialGroup.setTargetType(StoryGroupStyle.SERIAL.getTargetType());</span><br><span class="line">        gameSerialGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        gameSerialGroup.setSerialStories(smartGameSerialStoryResponse.getSerialStoryList());</span><br><span class="line">        response.setGameSerialGroup(gameSerialGroup);</span><br><span class="line"></span><br><span class="line">        <span class="comment">//传统文化14</span></span><br><span class="line">        List&lt;DisplayGroup&gt; traditionCultureGroupList = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        DisplayGroup traditionCultureGroup =  displayGroupService.getGroupById(<span class="number">14L</span>);</span><br><span class="line">        Page&lt;Story&gt; storyPage14 = groupRelevanceService.getNewGroupStoryList(user, <span class="number">14</span>, <span class="number">0</span>, <span class="number">6</span>);</span><br><span class="line">        traditionCultureGroup.setStorys(storyPage14.getContent());</span><br><span class="line">        traditionCultureGroupList.add(traditionCultureGroup);</span><br><span class="line">        response.setTraditionCultureGroup(traditionCultureGroupList);</span><br><span class="line">        <span class="comment">//其他分类 暂无</span></span><br><span class="line"></span><br><span class="line">        <span class="comment">//Prompt</span></span><br><span class="line">        Prompt prompt = <span class="keyword">new</span> Prompt(PromptStyle.STUDY_PLAN.getId(),PromptStyle.STUDY_PLAN.getName(),PromptStyle.STUDY_PLAN.getUrl());</span><br><span class="line">        <span class="keyword">if</span>(userid!=<span class="number">0</span>)&#123;</span><br><span class="line">            <span class="keyword">try</span> &#123;</span><br><span class="line">                prompt = promptService.getPrompt(userid);</span><br><span class="line">            &#125;<span class="keyword">catch</span> (Exception e)&#123;</span><br><span class="line">                e.printStackTrace();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        response.setPrompt(prompt);</span><br><span class="line">        <span class="comment">//isSvip</span></span><br><span class="line">        <span class="keyword">if</span> (user != <span class="keyword">null</span> &amp;&amp; (user.getSvip().equals(SvipStyle.LEVEL_FOUR.getId()) || user.getSvip().equals(SvipStyle.LEVEL_THREE.getId())))&#123;</span><br><span class="line">            response.setIsSvip(<span class="number">1</span>);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            response.setIsSvip(<span class="number">0</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> response;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>Thread controller</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="meta">@RequestMapping</span>(value = <span class="string">"sgetIndex"</span>, method = RequestMethod.GET)</span><br><span class="line">   <span class="meta">@ResponseBody</span></span><br><span class="line">   <span class="meta">@ApiOperation</span>(value = <span class="string">"首页 "</span>)</span><br><span class="line">   <span class="function">GetIndex280Response <span class="title">getIndex</span><span class="params">(</span></span></span><br><span class="line"><span class="function"><span class="params">           @RequestHeader(value = <span class="string">"ssToken"</span>, required = <span class="keyword">false</span>)</span> String ssToken,</span></span><br><span class="line"><span class="function">           @<span class="title">ApiParam</span><span class="params">(value = <span class="string">"版本号"</span>, defaultValue = <span class="string">""</span>, required = <span class="keyword">false</span>)</span> @<span class="title">RequestParam</span><span class="params">(required = <span class="keyword">false</span>, defaultValue = <span class="string">""</span>)</span> String ver</span></span><br><span class="line"><span class="function">   )</span>&#123;</span><br><span class="line">    </span><br><span class="line">       <span class="comment">//使用线程增加故事</span></span><br><span class="line">       <span class="keyword">final</span> ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(<span class="number">15</span>);</span><br><span class="line">    </span><br><span class="line">       <span class="comment">/**</span></span><br><span class="line"><span class="comment">        * 线程集合</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">       ThreadResult threadResult=<span class="keyword">new</span> ThreadResult();</span><br><span class="line">       Long loginId=(Long)request.getAttribute(<span class="string">"loginId"</span>);</span><br><span class="line">       User user=userService.getUser(loginId.intValue());</span><br><span class="line">       logger.info(<span class="string">"-------------begin"</span>);</span><br><span class="line">       GetIndex280Response response = <span class="keyword">this</span>.getIndex280(user, <span class="number">3</span>,threadResult);</span><br><span class="line">    </span><br><span class="line">       logger.info(<span class="string">"-------------3"</span>);</span><br><span class="line">       threadResult.groupPromptThread=<span class="keyword">new</span> GroupPromptThread(promptService,user);</span><br><span class="line">       response=<span class="keyword">this</span>.responseSetThreadValue2(response,executor,threadResult);</span><br><span class="line">       logger.info(<span class="string">"-------------end resp"</span>);</span><br><span class="line">       <span class="keyword">return</span> response;</span><br><span class="line">   &#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br></pre></td><td class="code"><pre><span class="line">  <span class="function"><span class="keyword">private</span> GetIndex280Response <span class="title">getIndex280</span><span class="params">(User user, Integer serialPageSize,ThreadResult threadResult)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">        GetIndex280Response response = <span class="keyword">new</span> GetIndex280Response();</span><br><span class="line">        <span class="comment">//判断svip</span></span><br><span class="line">        <span class="keyword">if</span>(user != <span class="keyword">null</span> &amp;&amp;(user.getSvip().equals(SvipStyle.LEVEL_FOUR.getId()) || user.getSvip().equals(SvipStyle.LEVEL_THREE.getId())))&#123;</span><br><span class="line">            response.setIsSvip(<span class="number">1</span>);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            response.setIsSvip(<span class="number">0</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        logger.info(<span class="string">"-------------001"</span>);</span><br><span class="line">        <span class="comment">//判断设备</span></span><br><span class="line">        Integer isCheckVer = <span class="number">0</span>;</span><br><span class="line">        String userAgent = request.getHeader(<span class="string">"User-Agent"</span>);</span><br><span class="line">        <span class="keyword">if</span> (userAgent.contains(<span class="string">"ios"</span>)) &#123;</span><br><span class="line">            <span class="comment">//判断版本是否在审核中，获取config的ver是否等于当前版本</span></span><br><span class="line">            String key = <span class="string">"version"</span>;</span><br><span class="line">            <span class="keyword">if</span>(userAgent.contains(<span class="string">"appname:zhijianStory"</span>))&#123;</span><br><span class="line">                key = <span class="string">"zhijianStory"</span>+<span class="string">"_version"</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            Config config=<span class="keyword">this</span>.configService.getConfigByKey(key);</span><br><span class="line">            String ver = VersionUtil.getVerionInfo(request);</span><br><span class="line">            <span class="keyword">if</span>(ver.compareTo(config.getVal()) == <span class="number">0</span>)&#123;</span><br><span class="line">                isCheckVer = <span class="number">1</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        logger.info(<span class="string">"-------------0011"</span>);</span><br><span class="line">        <span class="comment">//处理广告</span></span><br><span class="line">        String channel = request.getHeader(<span class="string">"channel"</span>);</span><br><span class="line">        String platform= VersionUtil.getPlatformStr(request);</span><br><span class="line">        String ver=VersionUtil.getVerionInfo(request);</span><br><span class="line">        threadResult.groupAdThread=<span class="keyword">new</span> GroupAdThread(adsService,channel,platform,isCheckVer,ver,user);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------------0016"</span>);</span><br><span class="line">        <span class="comment">//精品推荐</span></span><br><span class="line">        Ads ads = <span class="keyword">new</span> Ads();</span><br><span class="line">        ads.setTitle(<span class="string">"精品推荐"</span>);</span><br><span class="line">        ads.setContent(<span class="string">"精品推荐"</span>);</span><br><span class="line">        ads.setUrl(<span class="string">"www.baidu.com"</span>);</span><br><span class="line">        ads.setImgPath(<span class="string">"recommend.png"</span>);</span><br><span class="line">        ads.setIcon(<span class="string">"recommend.png"</span>);</span><br><span class="line">        ads.setId(<span class="number">0L</span>);</span><br><span class="line">        ads.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        ads.setTargetType(<span class="number">0</span>);</span><br><span class="line">        ads.setStatus(<span class="number">0</span>);</span><br><span class="line">        ads.setOrderBy(<span class="number">0</span>);</span><br><span class="line">        ads.setCreateTime(<span class="keyword">new</span> Date());</span><br><span class="line">        ads.setIsIosVisual(<span class="number">0</span>);</span><br><span class="line">        ads.setAdsPosition(<span class="number">0</span>);</span><br><span class="line"></span><br><span class="line">        CustomGroup recommendGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        recommendGroup.setId(<span class="number">1006L</span>);</span><br><span class="line">        recommendGroup.setName(<span class="string">"精品推荐"</span>);</span><br><span class="line">        recommendGroup.setContent(<span class="string">"精品推荐"</span>);</span><br><span class="line">        recommendGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        recommendGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        recommendGroup.setTargetType(StoryGroupStyle.RECOMMEND.getTargetType());</span><br><span class="line">        recommendGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        recommendGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        recommendGroup.setAds(ads);</span><br><span class="line">        response.setRecommendGroup(recommendGroup);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------------00113"</span>);</span><br><span class="line">        <span class="keyword">if</span>(user!=<span class="keyword">null</span> &amp;&amp; user.getId()!=<span class="number">0</span>)&#123;</span><br><span class="line">            Page&lt;UserReadRecord&gt; readRecordPage = userReadRecordService.getReadStoryRecordByUserIdAndType(user.getId(), <span class="number">1</span>, <span class="number">0</span>, <span class="number">4</span>);</span><br><span class="line">            CustomGroup userReadRecordGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">            userReadRecordGroup.setId(<span class="number">1004L</span>);</span><br><span class="line">            userReadRecordGroup.setName(<span class="string">"故事足迹"</span>);</span><br><span class="line">            userReadRecordGroup.setContent(<span class="string">"故事足迹"</span>);</span><br><span class="line">            userReadRecordGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">            userReadRecordGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">            userReadRecordGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">            userReadRecordGroup.setTargetType(StoryGroupStyle.STORY.getTargetType());</span><br><span class="line">            userReadRecordGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">            userReadRecordGroup.setUserReadRecordList(readRecordPage.getContent());</span><br><span class="line">            List&lt;Story&gt; storys = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">            <span class="keyword">for</span> (UserReadRecord s:readRecordPage.getContent()) &#123;</span><br><span class="line">                storys.add(s.getStory());</span><br><span class="line">            &#125;</span><br><span class="line">            userReadRecordGroup.setStorys(storys);</span><br><span class="line">            response.setUserReadRecordGroup(userReadRecordGroup);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//飞船电台</span></span><br><span class="line">        List&lt;Story&gt; radioList = storyService.getRadioList();</span><br><span class="line">        CustomGroup radioGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        radioGroup.setId(<span class="number">1005L</span>);</span><br><span class="line">        radioGroup.setName(<span class="string">"飞船电台"</span>);</span><br><span class="line">        radioGroup.setContent(<span class="string">"飞船电台"</span>);</span><br><span class="line">        radioGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        radioGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        radioGroup.setTargetType(StoryGroupStyle.AUDIO.getTargetType());</span><br><span class="line">        radioGroup.setTargetValue(<span class="number">0</span>);</span><br><span class="line">        radioGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        radioGroup.setStorys(radioList);</span><br><span class="line">        response.setRadioGroup(radioGroup);</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------------0010"</span>);</span><br><span class="line">        LessonIndex lessonIndex = <span class="keyword">new</span> LessonIndex();</span><br><span class="line">        lessonIndex.setName(<span class="string">"精品课程"</span>);</span><br><span class="line">        lessonIndex.setContent(<span class="string">"精品课程"</span>);</span><br><span class="line">        lessonIndex.setIntro(<span class="string">""</span>);</span><br><span class="line">        lessonIndex.setTargetType(StoryGroupStyle.LESSON.getTargetType());</span><br><span class="line">        lessonIndex.setLessonList(lessonService.getLessonList());</span><br><span class="line">        response.setLessonIndex(lessonIndex);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------益智游戏专区------003"</span>);</span><br><span class="line">        List&lt;CustomGroup&gt; cgroups = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        CustomGroup gameSerialGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        gameSerialGroup.setId(<span class="number">1003L</span>);</span><br><span class="line">        gameSerialGroup.setName(<span class="string">"益智游戏专区"</span>);</span><br><span class="line">        gameSerialGroup.setContent(<span class="string">"益智游戏专区"</span>);</span><br><span class="line">        gameSerialGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        gameSerialGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        gameSerialGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        cgroups.add(gameSerialGroup);</span><br><span class="line">        GroupSerialThread groupSerialThread3=<span class="keyword">new</span> GroupSerialThread(serialStoryService,SerialStoryStyle.SMART_GAME_SERIAL,user,<span class="number">0</span>,serialPageSize);</span><br><span class="line">        threadResult.serialThreads.add(groupSerialThread3);</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------ip专区------002"</span>);</span><br><span class="line">        CustomGroup ipSerialGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        ipSerialGroup.setId(<span class="number">1002L</span>);</span><br><span class="line">        ipSerialGroup.setName(<span class="string">"ip专区"</span>);</span><br><span class="line">        ipSerialGroup.setContent(<span class="string">"ip专区"</span>);</span><br><span class="line">        ipSerialGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        ipSerialGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        ipSerialGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        cgroups.add(ipSerialGroup);</span><br><span class="line">        GroupSerialThread groupSerialThread2=<span class="keyword">new</span> GroupSerialThread(serialStoryService,SerialStoryStyle.IP_STORY_SERIAL,user,<span class="number">0</span>,serialPageSize);</span><br><span class="line">        threadResult.serialThreads.add(groupSerialThread2);</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------绘本丛书------000"</span>);</span><br><span class="line">        CustomGroup huiBenGroup = <span class="keyword">new</span> CustomGroup();</span><br><span class="line">        huiBenGroup.setId(<span class="number">1000L</span>);</span><br><span class="line">        huiBenGroup.setName(<span class="string">"绘本丛书"</span>);</span><br><span class="line">        huiBenGroup.setContent(<span class="string">""</span>);</span><br><span class="line">        huiBenGroup.setIcon(<span class="string">""</span>);</span><br><span class="line">        huiBenGroup.setPadIcon(<span class="string">""</span>);</span><br><span class="line">        huiBenGroup.setIsSubscribe(<span class="number">0</span>);</span><br><span class="line">        cgroups.add(huiBenGroup);</span><br><span class="line">        GroupSerialThread groupSerialThread=<span class="keyword">new</span> GroupSerialThread(serialStoryService,SerialStoryStyle.INDEX_SERIAL,user,<span class="number">0</span>,serialPageSize);</span><br><span class="line">        threadResult.serialThreads.add(groupSerialThread);</span><br><span class="line"></span><br><span class="line">        response.setSerialStoryCount(<span class="number">3</span>);</span><br><span class="line"></span><br><span class="line">        <span class="comment">//获取分组列表</span></span><br><span class="line"><span class="comment">//        List&lt;DisplayGroup&gt; displayGroups = storyService.getStoryGroupListByNewCategory();</span></span><br><span class="line">        DisplayGroup group9 = displayGroupService.getGroupById(<span class="number">9L</span>);</span><br><span class="line">        group9.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line">        DisplayGroup group12 = displayGroupService.getGroupById(<span class="number">12L</span>);</span><br><span class="line">        group12.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line">        DisplayGroup group10 = displayGroupService.getGroupById(<span class="number">10L</span>);</span><br><span class="line">        group10.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line">        DisplayGroup group11 = displayGroupService.getGroupById(<span class="number">11L</span>);</span><br><span class="line">        group11.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line">        DisplayGroup group17 = displayGroupService.getGroupById(<span class="number">17L</span>);</span><br><span class="line">        group17.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line">        DisplayGroup group14 = displayGroupService.getGroupById(<span class="number">14L</span>);</span><br><span class="line">        group14.setStorys(<span class="keyword">new</span> ArrayList&lt;Story&gt;());</span><br><span class="line"></span><br><span class="line">        response.setSerialGroup(huiBenGroup);</span><br><span class="line">        response.setGameSerialGroup(gameSerialGroup);</span><br><span class="line">        response.setIpStoryGroup(ipSerialGroup);</span><br><span class="line"></span><br><span class="line">        List&lt;DisplayGroup&gt; newStoryGroup = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        newStoryGroup.add(group17);</span><br><span class="line">        List&lt;DisplayGroup&gt; classicAndCreateGroup = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        classicAndCreateGroup.add(group9);</span><br><span class="line">        classicAndCreateGroup.add(group12);</span><br><span class="line">        List&lt;DisplayGroup&gt; emotionAndHumourGroup = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        emotionAndHumourGroup.add(group10);</span><br><span class="line">        emotionAndHumourGroup.add(group11);</span><br><span class="line">        List&lt;DisplayGroup&gt; traditionCultureGroup = <span class="keyword">new</span> ArrayList&lt;&gt;();</span><br><span class="line">        traditionCultureGroup.add(group14);</span><br><span class="line"></span><br><span class="line">        response.setNewStoryGroup(newStoryGroup);</span><br><span class="line">        response.setClassicAndCreateGroup(classicAndCreateGroup);</span><br><span class="line">        response.setEmotionAndHumourGroup(emotionAndHumourGroup);</span><br><span class="line">        response.setTraditionCultureGroup(traditionCultureGroup);</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------------003"</span>);</span><br><span class="line">        <span class="comment">//最新故事 groupId 9 经典故事 10 情感教育  11 幽默故事  12 创意思维 14 传统文化 16 飞船电台  17 最新故事</span></span><br><span class="line">        <span class="comment">//9  12</span></span><br><span class="line">        GroupStoryThread groupStoryThread9=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">9</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread9);</span><br><span class="line">        GroupStoryThread groupStoryThread12=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">12</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread12);</span><br><span class="line">        <span class="comment">// 10  11</span></span><br><span class="line">        GroupStoryThread groupStoryThread10=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">10</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread10);</span><br><span class="line">        GroupStoryThread groupStoryThread11=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">11</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread11);</span><br><span class="line">        <span class="comment">// 17</span></span><br><span class="line">        GroupStoryThread groupStoryThread17=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">17</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread17);</span><br><span class="line">        <span class="comment">// 14</span></span><br><span class="line">        GroupStoryThread groupStoryThread14=<span class="keyword">new</span> GroupStoryThread(groupRelevanceService,user,<span class="number">14</span>,<span class="number">0</span>,<span class="number">6</span>);</span><br><span class="line">        threadResult.storyThreads.add(groupStoryThread14);</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"-------------004"</span>);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> response;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">private</span> GetIndex280Response <span class="title">responseSetThreadValue2</span><span class="params">(GetIndex280Response response, ExecutorService executor, ThreadResult threadResult)</span></span>&#123;</span><br><span class="line">        logger.info(<span class="string">"=====1"</span>);</span><br><span class="line">        <span class="keyword">for</span>(GroupStoryThread groupStoryThreadItem:threadResult.storyThreads)&#123;</span><br><span class="line">            executor.execute(groupStoryThreadItem);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        executor.execute(threadResult.groupAdThread);</span><br><span class="line">        <span class="keyword">for</span>(GroupSerialThread groupSerialThread:threadResult.serialThreads)&#123;</span><br><span class="line">            executor.execute(groupSerialThread);</span><br><span class="line">        &#125;</span><br><span class="line">        executor.execute(threadResult.groupAdThread);</span><br><span class="line">        <span class="keyword">if</span>(threadResult.groupPromptThread!=<span class="keyword">null</span>)&#123;</span><br><span class="line">            executor.execute(threadResult.groupPromptThread);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"=====2"</span>);</span><br><span class="line">        <span class="keyword">try</span> &#123;</span><br><span class="line">            executor.shutdown();</span><br><span class="line">            executor.awaitTermination(<span class="number">5</span>, TimeUnit.SECONDS);</span><br><span class="line">        &#125; <span class="keyword">catch</span> (InterruptedException ignored) &#123;</span><br><span class="line">            ignored.printStackTrace();</span><br><span class="line">        &#125;</span><br><span class="line">        logger.info(<span class="string">"=====3"</span>);</span><br><span class="line">        <span class="comment">//最新故事 groupId  1 互动故事 2 益智游戏 3 限时免费 4 精品课程  5 系列故事  6 睡前故事  7 热销故事 8 音频 9 经典故事</span></span><br><span class="line">        <span class="comment">//10 情感教育  11 幽默故事  12 创意思维 13 小程序试看  14 传统文化 16 飞船电台  17 最新故事</span></span><br><span class="line">        <span class="comment">//赋值</span></span><br><span class="line">        <span class="keyword">for</span>(GroupStoryThread groupStoryThread1:threadResult.storyThreads)&#123;</span><br><span class="line"><span class="comment">//            if(groupStoryThread1.getGroupId()==3)&#123;</span></span><br><span class="line"><span class="comment">//                response.getGroups().get(0).setStorys(groupStoryThread1.getStoryPage().getContent());</span></span><br><span class="line"><span class="comment">//            &#125;</span></span><br><span class="line">            <span class="comment">// 9经典故事  12创意思维</span></span><br><span class="line">            <span class="keyword">if</span>(groupStoryThread1.getGroupId()==<span class="number">9</span>)&#123;</span><br><span class="line">                response.getClassicAndCreateGroup().get(<span class="number">0</span>).setStorys(groupStoryThread1.getStoryPage().getContent());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span>(groupStoryThread1.getGroupId()==<span class="number">12</span>)&#123;</span><br><span class="line">                response.getClassicAndCreateGroup().get(<span class="number">1</span>).setStorys(groupStoryThread1.getStoryPage().getContent());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">//10 情感教育  11 幽默故事</span></span><br><span class="line">            <span class="keyword">if</span>(groupStoryThread1.getGroupId()==<span class="number">10</span>)&#123;</span><br><span class="line">                response.getEmotionAndHumourGroup().get(<span class="number">0</span>).setStorys(groupStoryThread1.getStoryPage().getContent());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span>(groupStoryThread1.getGroupId()==<span class="number">11</span>)&#123;</span><br><span class="line">                response.getEmotionAndHumourGroup().get(<span class="number">1</span>).setStorys(groupStoryThread1.getStoryPage().getContent());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">// 17最新故事</span></span><br><span class="line">            <span class="keyword">if</span>(groupStoryThread1.getGroupId()==<span class="number">17</span>)&#123;</span><br><span class="line">                response.getNewStoryGroup().get(<span class="number">0</span>).setStorys(groupStoryThread1.getStoryPage().getContent());</span><br><span class="line">            &#125;</span><br><span class="line"><span class="comment">//            for(DisplayGroup displayGroup:response.getGroupList())&#123;</span></span><br><span class="line"><span class="comment">//                if(groupStoryThread1.getGroupId()==displayGroup.getId().intValue())&#123;</span></span><br><span class="line"><span class="comment">//                    if(displayGroup==null)&#123;</span></span><br><span class="line"><span class="comment">//                        continue;</span></span><br><span class="line"><span class="comment">//                    &#125;</span></span><br><span class="line"><span class="comment">//                    displayGroup.setStorys(groupStoryThread1.getStoryPage().getContent());</span></span><br><span class="line"><span class="comment">//                &#125;</span></span><br><span class="line"><span class="comment">//            &#125;</span></span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">for</span>(GroupSerialThread groupSerialThread:threadResult.serialThreads)&#123;</span><br><span class="line">            <span class="comment">//绘本</span></span><br><span class="line">            <span class="keyword">if</span>(response.getSerialGroup().getId()==<span class="number">1000L</span>&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.INDEX_SERIAL)&#123;</span><br><span class="line">                response.getSerialGroup().setSerialStories(groupSerialThread.getSerialStoryList());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">//IP专区</span></span><br><span class="line">            <span class="keyword">if</span>(response.getIpStoryGroup().getId()==<span class="number">1002L</span>&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.IP_STORY_SERIAL)&#123;</span><br><span class="line">                response.getIpStoryGroup().setSerialStories(groupSerialThread.getSerialStoryList());</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">//益智专区</span></span><br><span class="line">            <span class="keyword">if</span>(response.getGameSerialGroup().getId()==<span class="number">1003L</span>&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.SMART_GAME_SERIAL)&#123;</span><br><span class="line">                response.getGameSerialGroup().setSerialStories(groupSerialThread.getSerialStoryList());</span><br><span class="line">            &#125;</span><br><span class="line"><span class="comment">//            for(CustomGroup customGroup:response.getGroups())&#123;</span></span><br><span class="line"><span class="comment">//                if(customGroup.getId()==1000L&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.INDEX_SERIAL)&#123;</span></span><br><span class="line"><span class="comment">//                    customGroup.setSerialStories(groupSerialThread.getSerialStoryList());</span></span><br><span class="line"><span class="comment">//                &#125;</span></span><br><span class="line"><span class="comment">//                if(customGroup.getId()==1002L&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.IP_STORY_SERIAL)&#123;</span></span><br><span class="line"><span class="comment">//                    customGroup.setSerialStories(groupSerialThread.getSerialStoryList());</span></span><br><span class="line"><span class="comment">//                &#125;</span></span><br><span class="line"><span class="comment">//                if(customGroup.getId()==1003L&amp;&amp;groupSerialThread.getSerialStoryStyle()==SerialStoryStyle.SUBJECT_SERIAL)&#123;</span></span><br><span class="line"><span class="comment">//                    customGroup.setSerialStories(groupSerialThread.getSerialStoryList());</span></span><br><span class="line"><span class="comment">//                &#125;</span></span><br><span class="line"><span class="comment">//            &#125;</span></span><br><span class="line">        &#125;</span><br><span class="line">        response.setAds(threadResult.groupAdThread.getAdsList());</span><br><span class="line">        <span class="keyword">if</span>(threadResult.groupPromptThread!=<span class="keyword">null</span>)&#123;</span><br><span class="line">            response.setPrompt(threadResult.groupPromptThread.getPrompt());</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        logger.info(<span class="string">"=====4"</span>);</span><br><span class="line">        <span class="keyword">return</span> response;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2018/11/05/多线程查询/" data-id="ckcc5iwly0047q4uwzdx2b6cs" class="article-share-link">Teilen</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/线程/">线程</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2018/11/06/pay_wxPay/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Neuer</strong>
      <div class="article-nav-title">
        
          wxPay
        
      </div>
    </a>
  
  
    <a href="/2018/11/05/Exceutor/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">Exceutor</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design-Patterns/">Design Patterns</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Html/">Html</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Http/">Http</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sort/">Sort</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/algorithm/">algorithm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ali-weixin-pay/">ali/weixin pay</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/elasticsearch/">elasticsearch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/idea/">idea</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jvm/">jvm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logstash/">logstash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mysql/">mysql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pytest/">pytest</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/springboot/">springboot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/util/">util</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vue/">vue</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wechat/">wechat</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/我的世界/">我的世界</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/消息队列/">消息队列</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/线程/">线程</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Design-Patterns/" style="font-size: 16.36px;">Design Patterns</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/Html/" style="font-size: 10px;">Html</a> <a href="/tags/Http/" style="font-size: 12.73px;">Http</a> <a href="/tags/JavaScript/" style="font-size: 15.45px;">JavaScript</a> <a href="/tags/Sort/" style="font-size: 18.18px;">Sort</a> <a href="/tags/algorithm/" style="font-size: 11.82px;">algorithm</a> <a href="/tags/ali-weixin-pay/" style="font-size: 13.64px;">ali/weixin pay</a> <a href="/tags/docker/" style="font-size: 17.27px;">docker</a> <a href="/tags/elasticsearch/" style="font-size: 10px;">elasticsearch</a> <a href="/tags/go/" style="font-size: 11.82px;">go</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/idea/" style="font-size: 10px;">idea</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/jvm/" style="font-size: 11.82px;">jvm</a> <a href="/tags/linux/" style="font-size: 18.18px;">linux</a> <a href="/tags/logstash/" style="font-size: 12.73px;">logstash</a> <a href="/tags/mysql/" style="font-size: 14.55px;">mysql</a> <a href="/tags/php/" style="font-size: 11.82px;">php</a> <a href="/tags/pytest/" style="font-size: 10px;">pytest</a> <a href="/tags/python/" style="font-size: 13.64px;">python</a> <a href="/tags/springboot/" style="font-size: 17.27px;">springboot</a> <a href="/tags/util/" style="font-size: 19.09px;">util</a> <a href="/tags/vue/" style="font-size: 10px;">vue</a> <a href="/tags/wechat/" style="font-size: 10.91px;">wechat</a> <a href="/tags/我的世界/" style="font-size: 10px;">我的世界</a> <a href="/tags/消息队列/" style="font-size: 10.91px;">消息队列</a> <a href="/tags/线程/" style="font-size: 11.82px;">线程</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">March 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">January 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/">January 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">December 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/">October 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/">September 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/">May 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/">March 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/">January 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">December 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/05/17/linux/linux_shell/">linux—shell</a>
          </li>
        
          <li>
            <a href="/2020/05/16/linux/linux_awk_sed/">linux-awk\sed 示例</a>
          </li>
        
          <li>
            <a href="/2020/04/11/linux/linux_bash/">linux—bash</a>
          </li>
        
          <li>
            <a href="/2020/03/29/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2020/03/16/go基础/">go基础知识</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 vchen<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>